﻿using MediatR;
using SystemWFH.API.Application.Command.InspectionCommand;
using SystemWFH.Domain;
using SystemWFH.Infrstructer.Impl;
using SystemWFH.Infrstructer.Interface;

namespace SystemWFH.API.Application.CommandHandlers.InspectionCommandHandler
{
    public class InspectionFindCommandHandler : IRequestHandler<InspectionFindCommand, Inspection>
    {
        private readonly IInspectionRepository inspectionRepository;
        public InspectionFindCommandHandler(IInspectionRepository inspectionRepository)
        {
            this.inspectionRepository = inspectionRepository;
        }
        public async Task<Inspection> Handle(InspectionFindCommand request, CancellationToken cancellationToken)
        {
            var list = await inspectionRepository.GetValue(request.inspectionId);
            return list;
        }
    }
}
